<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html"/>
  <xsl:template match="/">
    <style type="text/css" media="screen">
      body
      {
      margin: 0 0 0 0;
      font-family: arial;
      font-size: 8px;
      }


      #boxnota
      {
      border: solid 1px #000;
      text-align: center;
      width: 40px;
      font-weight: bold;
      }

      .TDTrimestre table tr td#boxnota
      {
      border: none;
      width: 160px;
      }
      .tbAlumno
      {
      border-collapse: collapse;
      background-color: #732808;
      width: 100%;
      height: 50px;
      border: solid 5px #732808;
      }
      .TDTitle
      {
      /*BORDER-RIGHT: #c7c8ca 2px solid;    BORDER-TOP: #c7c8ca 2px solid; BORDER-LEFT: #c7c8ca 2px solid; COLOR: #ffffff; BORDER-BOTTOM: #c7c8ca 2px solid; BACKGROUND-COLOR: #732808;     */
      text-align: left;
      }
      .TDNombre
      {
      font-weight: bold;
      color: #ffffff;
      background-color: #c6c6c6;
      width: 160px;
      text-align: center;
      }
      .TDAlumno
      {
      font-weight: bold;
      font-size: 28px;
      color: white;
      text-align: center;
      }
      .TDNombreMateria
      {
      border: solid 1px #c3c3c3;
      font-weight: bold;
      background-color: #e0e2e1;
      text-align: center;
      width: 200px;
      }
      .TDNotas
      {
      border: #732808 2px solid;
      background-color: #e0e1e3 text-align:center;
      /*    width: 100px;*/
      }
      .TDNotasSPACE
      {
      border: #732808 2px solid;
      font-size: 10px;
      height: 40px;
      background-color: #732808;
      }
      .TDQuincena
      {
      font-weight: bold;
      color: white;
      background-color: #732808;
      text-align: center;
      border: #732808 2px solid;
      font-size: 10px;
      }

      .TDTrimestre, .TDResumen
      {
      text-align: center;
      font-weight: bold;
      height: 40px;
      background-color: #f0e1e3;
      border: solid 2px #732808;
      border-bottom: solid 9px #732808;
      border-top: solid 9px #732808;
      nowrap: nowrap;
      }
      .TDResumen
      {
      height: 40px;
      background-color: #E0C2C7;
      border: #732808 2px solid;
      width: 200px;
      nowrap: nowrap;
      }
      .Bt
      {
      border-right: 0px;
      border-top: 0px;
      border-left: 0px;
      cursor: hand;
      border-bottom: 0px;
      }
      .n1, .n2, .n3, .n4, .n5, .n6, .n7, .n8, .n9, .n10
      {
      text-align: center;
      }
      .n1, .n2, .n3, .n31, .n41
      {
      color: red;
      }
      .n4, .n5, .n61
      {
      color: green;
      }
      .n6, .n7, .n8, .n9, .n10
      {
      color: blue;
      }
    </style>

    <style type="text/css" media="print">
      body
      {
      margin: 0 0 0 0;
      zoom: .7;
      }
      table
      {
      table-layout: auto;
      border-collapse: collapse;
      }
      .noprint
      {
      display: none;
      }

      #boxnota{
      border:solid 1px #000;
      text-align:center;
      font-size:50px;
      width:40px;
      FONT-WEIGHT: bold;
      }

      .TDTrimestre table tr td#boxnota{
      border:none;
      width:160px;
      font-size:50px;
      }
      .tbAlumno{
      BORDER-COLLAPSE: collapse;
      background-color: #732808;
      width:100%;
      height:50px;
      border:solid 5px #732808;
      }

      .TDTitle img{
      zoom:3;
      }

      .TDNombre {
      FONT-WEIGHT: bold;
      FONT-SIZE: 30px;
      COLOR: #ffffff;
      BACKGROUND-COLOR: #c6c6c6;
      WIDTH: 160px;
      text-align:center;
      }
      .TDAlumno{
      FONT-WEIGHT: bold;
      FONT-SIZE: 50px;
      COLOR: white;
      TEXT-ALIGN: center
      }
      .TDNombreMateria {
      font-size:40px;
      FONT-WEIGHT: bold;
      BACKGROUND-COLOR: #e0e2e1;
      TEXT-ALIGN: center;
      width:200px;
      border:solid 1px #c3c3c3;

      }
      .TDNotas {
      BORDER: #732808 2px solid;
      FONT-SIZE: 12px;
      BACKGROUND-COLOR: #e0e1e3
      text-align:center;
      /*     width:100px;*/

      }
      .TDNotasSPACE {
      BORDER: #732808 2px solid;
      FONT-SIZE: 10px;
      HEIGHT: 40px; BACKGROUND-COLOR: #732808
      }
      .TDQuincena {
      FONT-WEIGHT: bold;
      COLOR: white;
      BACKGROUND-COLOR: #732808; TEXT-ALIGN: center;
      BORDER: #732808 2px solid;
      height:80px;
      font-size:40px;
      }

      .TDTrimestre,.TDResumen  {
      text-align:center;
      FONT-WEIGHT: bold;
      BACKGROUND-COLOR: #f0e1e3;
      BORDER: solid 2px #732808 ;
      border-bottom:solid 9px #732808 ;
      border-top:solid 9px #732808 ;
      nowrap:nowrap;
      height:100px;
      font-size:40px;
      }
      .TDResumen {
      BACKGROUND-COLOR:#E0C2C7;
      BORDER: #732808 2px solid;
      width:200px;
      nowrap:nowrap;
      font-size:40px;

      }
      .Bt {
      BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; CURSOR: hand; BORDER-BOTTOM: 0px
      }
      .n1,.n2,.n3,.n4,.n5,.n6,.n7,.n8,.n9,.n10{      text-align:center;}
      .n1,.n2,.n3{    color:red; }
      .n4,.n5{  color:green;}
      .n6,.n7,.n8,.n9,.n10{     color:blue;     }
    </style>
    <style type="text/css" media="screen">
      DIV#tbl-container {
      OVERFLOW: auto; WIDTH: 800px; HEIGHT: 500px
      }
      TABLE {
      TABLE-LAYOUT: auto; BORDER-COLLAPSE: collapse
      }

      THEAD TH {
      BORDER-RIGHT: silver 1px solid; FONT-WEIGHT: bold; FONT-SIZE: 10px;
      POSITION: relative; TEXT-ALIGN: center
      }
      THEAD TH.locked {
      BORDER-RIGHT: silver 1px solid; FONT-WEIGHT: bold; FONT-SIZE: 10px;
      POSITION: relative; TEXT-ALIGN: center
      }
      THEAD TH {
      Z-INDEX: 20;
      TOP: expression(document.getElementById("tbl-container").scrollTop-2)
      }
      THEAD TH.locked {
      Z-INDEX: 30;
      }
      TD.locked {
      Z-INDEX: 10;
      LEFT: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
      POSITION: relative
      }
      TH.locked {
      Z-INDEX: 10;
      LEFT: expression(parentNode.parentNode.parentNode.parentNode.scrollLeft);
      POSITION: relative
      }
    </style>
    <table>
      <tbody>
        <tr>
          <td class="TDTitle">
            <img src="../images/iis-banner.jpg"/>
          </td>
        </tr>
        <tr>
          <td>
            <xsl:apply-templates select="alumno"/>
          </td>
        </tr>
        <tr>
          <td>
            <div id="tbl-container">
              <xsl:call-template name="planilla"/>
            </div>
          </td>
        </tr>
      </tbody>
      <tfoot>
      </tfoot>
    </table>
  </xsl:template>


  <!--- HEAD ALUMNO -->
  <xsl:template match="alumno">
    <table class="tbAlumno">
      <tbody>
        <tr>
          <td class="TDNombre">Nombre Alumno</td>
          <td class="TDAlumno">
            <xsl:value-of select="@nombre"/>
          </td>
          <td class="TDNombre" style="width: 37px">Año</td>
          <td class="TDAlumno">
            <xsl:value-of select="@Anio"/>
          </td>
          <td class="TDNombre" style="width: 37px">División</td>
          <td class="TDAlumno">
            <xsl:value-of select="@Curso"/>
          </td>
        </tr>
      </tbody>
    </table>
  </xsl:template>
  <!--- HEAD ALUMNO -->


  <!--notas-->
  <xsl:template name="planilla">
    <table id="tbl">
      <thead>
        <th class="locked TDNombreMateria">
          <div>&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</div>
        </th>
        <xsl:apply-templates select="alumno/Materias/Materia[@Tipo=1]"/>
        <th class="TDNombreMateria" style="width:200px">Directora</th>
        <th class="TDNotasSPACE">&#xA0;</th>
        <xsl:apply-templates select="alumno/Materias/Materia[@Tipo=2]"/>
        <th class="TDNombreMateria" style="width:200px">F.L. Head</th>
        <th class="TDNombreMateria" style="width:200px">Directora Gral</th>
        <th class="TDNotasSPACE">&#xA0;</th>
      </thead>
      <tbody>

        <xsl:apply-templates select="alumno/Periodos/Periodo"/>
        <xsl:apply-templates select="alumno/Periodos/Resumen"/>
      </tbody>
    </table>
  </xsl:template>

  <!--materias-->
  <xsl:template match="Materia">
    <th class="TDNombreMateria">
      <div style="width:190px;">
        <xsl:value-of select="@Nombre"/>
      </div>
    </th>
  </xsl:template>

  <!--Periodos-->
  <xsl:template match="Periodo">
    <xsl:variable name="idper">
      <xsl:value-of select="@IdPeriodo"/>
    </xsl:variable>
    <xsl:variable name="idEstilo">
      <xsl:value-of select="@Estilo"/>
    </xsl:variable>
    <tr>
      <td>
        <xsl:attribute name="class">
          locked <xsl:value-of select="@Estilo"/>
        </xsl:attribute>
        <xsl:choose>
          <xsl:when test="@FechaHasta=''">
            <xsl:value-of select="@FechaDesde"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="@Particion"/>
            <br/>
            <xsl:value-of select="@FechaDesde"/>al <xsl:value-of select="@FechaHasta"/>
          </xsl:otherwise>
        </xsl:choose>
      </td>
      <xsl:call-template name="GrupoNotas">
        <xsl:with-param name="idEstilo">
          <xsl:value-of select="$idEstilo"/>
        </xsl:with-param>
        <xsl:with-param name="idPer">
          <xsl:value-of select="$idper"/>
        </xsl:with-param>
        <xsl:with-param name="tipo">1</xsl:with-param>
      </xsl:call-template>
      <td class="TDNotas">
        <xsl:if test="$idEstilo='TDTrimestre'">
          <xsl:attribute name="class">
            <xsl:value-of select="$idEstilo"/>
          </xsl:attribute>
        </xsl:if>
        <div style="width:150px">&#xA0;</div>
      </td>
      <td class="TDNotasSPACE"></td>

      <xsl:call-template name="GrupoNotas">
        <xsl:with-param name="idEstilo">
          <xsl:value-of select="$idEstilo"/>
        </xsl:with-param>
        <xsl:with-param name="idPer">
          <xsl:value-of select="$idper"/>
        </xsl:with-param>
        <xsl:with-param name="tipo">2</xsl:with-param>
      </xsl:call-template>

      <td class="TDNotas">
        <xsl:if test="$idEstilo='TDTrimestre'">
          <xsl:attribute name="class">
            <xsl:value-of select="$idEstilo"/>
          </xsl:attribute>
        </xsl:if>
        <div style="width:150px">&#xA0;</div>
      </td>
      <td class="TDNotas">
        <xsl:if test="$idEstilo='TDTrimestre'">
          <xsl:attribute name="class">
            <xsl:value-of select="$idEstilo"/>
          </xsl:attribute>
        </xsl:if>
        <div style="width:150px">&#xA0;</div>
      </td>
      <td class="TDNotasSPACE"></td>
    </tr>
    <tr>
    </tr>
  </xsl:template>

  <xsl:template match="Resumen">
    <tr>
      <td class="locked TDResumen">
        <xsl:value-of select="@Nombre"/>
      </td>
      <xsl:for-each select="materia[@tipomateria=1]">
        <td class="TDResumen">
          <table>
            <tr>
              <xsl:apply-templates select="nota/modalidad" mode="Final">
              </xsl:apply-templates>
            </tr>
          </table>
        </td>
      </xsl:for-each>
      <td class="TDResumen">&#xA0;</td>
      <td class="TDNotasSPace">&#xA0;</td>
      <xsl:for-each select="materia[@tipomateria=2]">
        <td class="TDResumen">
          <table>
            <tr>
              <xsl:apply-templates select="nota/modalidad" mode="Final"/>
            </tr>
          </table>
        </td>
      </xsl:for-each>
      <td class="TDResumen">&#xA0;</td>
      <td class="TDResumen">&#xA0;</td>
      <td class="TDNotasSPACE"></td>
    </tr>
  </xsl:template>


  <xsl:template name="GrupoNotas">
    <xsl:param name="idPer"/>
    <xsl:param name="idEstilo"/>
    <xsl:param name="tipo"/>
    <xsl:for-each select="/alumno/Materias/Materia[@Tipo=$tipo]">
      <td class="TDNotas">
        <xsl:if test="$idEstilo='TDTrimestre'">
          <xsl:attribute name="class">
            <xsl:value-of select="$idEstilo"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:variable name="idmate">
          <xsl:value-of select="@IdMateria"/>
        </xsl:variable>
        <!--tengo las notas-->
        <table align="center">
          <xsl:for-each select="/alumno/Periodos/Periodo[@IdPeriodo=$idPer and @Estilo=$idEstilo]/materia[@IdMateria=$idmate]/nota">
            <tr>
              <xsl:apply-templates select="modalidad">
                <xsl:with-param name="idEstilo">
                  <xsl:value-of select="$idEstilo"/>
                </xsl:with-param>
              </xsl:apply-templates>
            </tr>
          </xsl:for-each>
        </table>
      </td>
    </xsl:for-each>
  </xsl:template>



  <xsl:template match="modalidad" mode="Final">
    <xsl:param name="idEstilo"/>
    <td>
      <xsl:if test="@nota!=-1">
        <xsl:attribute name="id">boxnota</xsl:attribute>
      </xsl:if>
      <!--erificar los colores segun la nota-->
      <xsl:attribute name="class">
        n<xsl:value-of select="round(@nota)"/><xsl:if test="@nota=3.50 or @nota=5.50">1</xsl:if>
      </xsl:attribute>

      <xsl:attribute name="title">
        <xsl:value-of select="../@Modalidad"/>/<xsl:value-of select="@observacion"/>
      </xsl:attribute>
      <xsl:if test="@nota=0">A</xsl:if>
      <xsl:if test="../@Modalidad=Promedio"></xsl:if>
      <xsl:if test="not(@nota=0) and @nota!=-1">
        <xsl:value-of select="@Letra"/>
      </xsl:if>
    </td>
  </xsl:template>
  <!--notas-->


  <xsl:template match="modalidad">
    <xsl:param name="idEstilo"/>
    <td id="boxnota">
      <!--erificar los colores segun la nota-->
      <xsl:attribute name="class">
        n<xsl:value-of select="round(@nota)"/><xsl:if test="@nota=3.50 or @nota=5.50">1</xsl:if>
      </xsl:attribute>

      <xsl:attribute name="title">
        <xsl:value-of select="../@Modalidad"/>/<xsl:value-of select="@observacion"/>
      </xsl:attribute>
      <xsl:if test="@nota=0">
        <xsl:if test="$idEstilo='TDTrimestre'">&#xA0;</xsl:if>

        <xsl:if test="not($idEstilo='TDTrimestre')">A</xsl:if>
      </xsl:if>
      <xsl:if test="../@Modalidad=Promedio"></xsl:if>
      <xsl:if test="not(@nota=0)">
        <xsl:value-of select="@Letra"/>
      </xsl:if>
    </td>
  </xsl:template>
  <!--notas-->
  <xsl:template match="nota">
    <td>
      <xsl:value-of select="@nota"/>
    </td>
  </xsl:template>

  <xsl:template name="zoomprint">
    <input type="text" name="zoom" id="zoom" value="80"></input>
  </xsl:template>
</xsl:stylesheet>
<!-- Stylus Studio meta-information - (c) 2004-2008. Progress Software Corporation. All rights reserved.

<metaInformation>
	<scenarios>
		<scenario default="yes" name="Scenario1" userelativepaths="yes" externalpreview="no" url="..\..\..\..\Temp\miData.xml" htmlbaseurl="" outputurl="" processortype="saxon8" useresolver="yes" profilemode="0" profiledepth="" profilelength=""
		          urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal"
		          customvalidator="">
			<advancedProp name="sInitialMode" value=""/>
			<advancedProp name="bXsltOneIsOkay" value="true"/>
			<advancedProp name="bSchemaAware" value="true"/>
			<advancedProp name="bXml11" value="false"/>
			<advancedProp name="iValidation" value="0"/>
			<advancedProp name="bExtensions" value="true"/>
			<advancedProp name="iWhitespace" value="0"/>
			<advancedProp name="sInitialTemplate" value=""/>
			<advancedProp name="bTinyTree" value="true"/>
			<advancedProp name="bWarnings" value="true"/>
			<advancedProp name="bUseDTD" value="false"/>
			<advancedProp name="iErrorHandling" value="fatal"/>
		</scenario>
	</scenarios>
	<MapperMetaTag>
		<MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no"/>
		<MapperBlockPosition></MapperBlockPosition>
		<TemplateContext></TemplateContext>
		<MapperFilter side="source"></MapperFilter>
	</MapperMetaTag>
</metaInformation>
-->